@import '../../styles/variables';

.dashboard-page {
  min-height: calc(100vh - 64px);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: @spacing-xl;

  .welcome-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: @spacing-2xl;
    margin-bottom: @spacing-xl;
    position: relative;
    overflow: hidden;
    color: @white;

    &::before {
      content: '';
      position: absolute;
      top: -50%;
      right: -20%;
      width: 200px;
      height: 200px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 50%;
    }

    h1 {
      font-size: @font-size-3xl;
      font-weight: 700;
      margin-bottom: @spacing-sm;
      background: linear-gradient(135deg, #fff 0%, #e2e8f0 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    p {
      font-size: @font-size-lg;
      opacity: 0.9;
      margin: 0;
    }

    .welcome-icon {
      position: absolute;
      right: @spacing-2xl;
      top: 50%;
      transform: translateY(-50%);
      opacity: 0.8;
    }
  }

  .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: @spacing-lg;
    margin-bottom: @spacing-xl;

    .stat-card {
      background: @white;
      border-radius: 16px;
      padding: @spacing-xl;
      box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
      border: 1px solid rgba(229, 231, 235, 0.5);
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
      overflow: hidden;

      &:hover {
        transform: translateY(-4px);
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
      }

      &::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, @primary-color, @primary-color-dark);
      }

      .stat-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: @spacing-md;

        .stat-icon {
          padding: @spacing-md;
          border-radius: 12px;
          color: @white;

          svg {
            width: 24px;
            height: 24px;
          }
        }

        .stat-change {
          background: rgba(34, 197, 94, 0.1);
          color: #16a34a;
          padding: @spacing-xs @spacing-sm;
          border-radius: 20px;
          font-size: @font-size-sm;
          font-weight: 600;
        }

        .status-indicator {
          width: 8px;
          height: 8px;
          border-radius: 50%;
        }
      }

      .stat-value {
        font-size: 2.5rem;
        font-weight: 700;
        color: @gray-900;
        margin-bottom: @spacing-xs;
        background: linear-gradient(135deg, @gray-900, @gray-700);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
      }

      .stat-title {
        font-size: @font-size-sm;
        color: @gray-600;
        font-weight: 500;
      }

      .stat-description {
        font-size: @font-size-xs;
        color: @gray-500;
        margin-top: @spacing-xs;
      }
    }
  }

  .main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: @spacing-xl;

    @media (min-width: @screen-lg) {
      grid-template-columns: 1fr 1fr;
    }

    .content-card {
      background: @white;
      border-radius: 16px;
      padding: @spacing-xl;
      box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
      border: 1px solid rgba(229, 231, 235, 0.5);

      .card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: @spacing-lg;

        h2 {
          font-size: @font-size-xl;
          font-weight: 600;
          color: @gray-900;
          margin: 0;
        }

        .view-all {
          color: @primary-color;
          font-size: @font-size-sm;
          font-weight: 500;
          text-decoration: none;
          transition: color 0.2s;

          &:hover {
            color: @primary-color-dark;
          }
        }
      }
    }
  }

  .task-item {
    display: flex;
    align-items: center;
    gap: @spacing-md;
    padding: @spacing-md;
    background: @gray-50;
    border-radius: 12px;
    margin-bottom: @spacing-md;
    transition: all 0.2s;

    &:hover {
      background: @gray-100;
      transform: translateX(4px);
    }

    .task-status {
      flex-shrink: 0;

      svg {
        width: 20px;
        height: 20px;
      }
    }

      .task-details {
        flex: 1;
        min-width: 0;

        .task-name {
          font-size: @font-size-sm;
          font-weight: 500;
          color: @gray-900;
          margin: 0;
          .truncate();
        }

        .task-actions {
          display: flex;
          gap: @spacing-xs;

          .btn {
            font-size: @font-size-xs;
            padding: @spacing-xs @spacing-sm;
            min-height: auto;
          }
        }

        .task-meta {
          display: flex;
          align-items: center;
          gap: @spacing-sm;
          margin-top: @spacing-xs;

          span {
            font-size: @font-size-xs;
            color: @gray-500;
          }

          .separator {
            color: @gray-300;
          }
        }

        .task-progress {
          margin-top: @spacing-sm;

          .progress-bar {
            width: 100%;
            height: 4px;
            background: @gray-200;
            border-radius: 2px;
            overflow: hidden;

            .progress-fill {
              height: 100%;
              background: linear-gradient(90deg, @primary-color, @primary-color-dark);
              border-radius: 2px;
              transition: width 0.3s ease;
            }
          }

          .progress-text {
            font-size: @font-size-xs;
            color: @gray-500;
            margin-top: @spacing-xs;
          }
        }

        .task-error {
          margin-top: @spacing-xs;

          .error-text {
            font-size: @font-size-xs;
            color: @red-600;
            background: rgba(239, 68, 68, 0.1);
            padding: @spacing-xs @spacing-sm;
            border-radius: 4px;
          }
        }
      }

    .task-more {
      text-align: center;
      margin-top: @spacing-md;

      .view-more {
        color: @primary-color;
        font-size: @font-size-sm;
        text-decoration: none;

        &:hover {
          color: @primary-color-dark;
        }
      }
    }
  }

  .empty-state {
    text-align: center;
    padding: @spacing-2xl;
    color: @gray-500;

    svg {
      width: 64px;
      height: 64px;
      margin-bottom: @spacing-md;
      opacity: 0.5;
    }

    p {
      margin: 0;
      font-size: @font-size-lg;
      font-weight: 500;
    }

    .empty-subtitle {
      font-size: @font-size-sm;
      margin-top: @spacing-xs;
      opacity: 0.7;
    }
  }

  .quick-actions {
    .action-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: @spacing-md;

      .action-button {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: @spacing-sm;
        padding: @spacing-lg;
        border: none;
        border-radius: 12px;
        font-weight: 500;
        font-size: @font-size-base;
        cursor: pointer;
        transition: all 0.3s ease;
        background: linear-gradient(135deg, @primary-color, @primary-color-dark);
        color: @white;

        &:hover {
          transform: translateY(-2px);
          box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.3);
        }

        &.secondary {
          background: @white;
          border: 2px solid @gray-200;
          color: @gray-700;

          &:hover {
            border-color: @primary-color;
            color: @primary-color;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
          }
        }

        svg {
          width: 20px;
          height: 20px;
        }
      }
    }
  }
}